package com.aurora.oa.work.view;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.aurora.oa.R;

/**
 * Created by Administrator on 2017/3/30 0030.
 */
public class WriteLogFragment extends Fragment implements View.OnClickListener{

    LinearLayout ll_log_ri;
    LinearLayout ll_log_zhou;
    LinearLayout ll_log_yue;
    Activity mAct;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        mAct = getActivity();
        View view = inflater.inflate(R.layout.fragment_write_log,container,false);
        ll_log_ri = (LinearLayout) view.findViewById(R.id.ll_log_ri);
        ll_log_zhou = (LinearLayout) view.findViewById(R.id.ll_log_zhou);
        ll_log_yue = (LinearLayout) view.findViewById(R.id.ll_log_yue);
        ll_log_ri.setOnClickListener(this);
        ll_log_zhou.setOnClickListener(this);
        ll_log_yue.setOnClickListener(this);
        return view;
    }

    @Override
    public void onClick(View view) {
        Intent intent = new Intent(mAct,WriteLogDetailActivity.class);
        switch (view.getId()){
            case R.id.ll_log_ri:
                intent.putExtra("log_type",1);
                break;
            case R.id.ll_log_zhou:
                intent.putExtra("log_type",2);
                break;
            case R.id.ll_log_yue:
                intent.putExtra("log_type",3);
                break;
        }
        startActivity(intent);
    }
}
